Various codes such as a QR code are used as a two-dimensional (2D) code which indicates information data as a 2D image pattern. Moreover, for example, as disclosed in patent documents 1 and 2, there have been developed systems for detecting a coordinate position in a display surface touched by an optical pen, by displaying the 2D code on the display surface or the like of a display and by bringing the optical pen to contact with the display surface.
The systems disclosed in the patent documents 1 and 2 use a 2D code in which a coordinate pattern of vertical six dots and horizontal six dots indicates one coordinate position. In the systems, the coordinate position is obtained from an image read on a photodetector provided for the optical pen, and then mutual correction and prediction correction are performed, wherein the mutual correction uses the fact that the x-coordinate of one coordinate pattern is equal to the x-coordinate of an another coordinate pattern which is adjacent in a lateral direction and that the y-coordinate of one coordinate pattern is equal to the y-coordinate of an another coordinate pattern which is adjacent in a longitudinal direction, and the prediction correction considers a relation between a coordinate Xn and a coordinate Xn+1 and a relation between a coordinate Yn and a coordinate Yn+1.    Patent document 1: Japanese Patent Application Laid Open No. Hei 5-290795    Patent document 2: Japanese Patent Application Laid Open No. 2001-234509